home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / disk / dirto707.zip / DIRTOTAL.DOC < prev    next >
Text File  |  1997-07-31  |  22KB  |  468 lines

  1. DIRTOTAL.DOC                           1                           Jul 31, 1997
  2.  
  3. WIN95 AND WINNT NOTICE:  As with most DOS-based utilities, this program doesn't
  4. understand the weird subdirectories, long filenames,  invalid  characters  that
  5. are possible under Windows 95 and Windows/NT.   Both  operating  systems  alias
  6. long filenames into names like MYFILE~1.TXT so that's what you're going to  see
  7. processed.  Under some file structure systems in NT, the program may  not  work
  8. at all.
  9.  
  10. The DIRTOTAL.EXE program is a directory-listing program.  It  produces  a  text
  11. file with the results of your search and is primarily  designed  for  inventory
  12. purposes.  It includes these features:
  13.  
  14.   * Can search an entire drive or part of a drive.
  15.   * Can search multiple drives.
  16.   * Can look for individual files or all files.
  17.   * Can select based on attributes, date, or size.
  18.   * Can extract information for archive files (ZIP, LZH, etc).
  19.   * Can look for duplicate file names.
  20.   * Can produce a couple of different report formats; see the "Syntax"  section
  21.     for examples.
  22.   * Works on a CD-ROM and network drives.
  23.   * The date format shown is based on your country setting.
  24.   * Can  be  used  to  produce  the  directory  information  as  a  tree   with
  25.     subdirectory counts and totals.
  26.   * Can be used to show the "top x" files on  the  disc  by  either  size  (for
  27.     example, largest files) or date (for example, most recent files).
  28.   * Pressing escape stops the program early.
  29.  
  30. DIRTOTAL goes through all directories on a given drive (or on multiple  drives)
  31. and writes out the names and space used for all files on that drive.  You  will
  32. also see directory totals and such.  (You  can  suppress  the  individual  file
  33. names listing if you want.)
  34.  
  35. Alternatively, you can have the utility restrict the search to just those files
  36. within a given subdirectory and its child subdirectories.  For example, if  you
  37. had a directory structure like this:
  38.  
  39.         +-- DOS
  40.         +-- TC -+-- KERMIT
  41.         |       +-- BANYAN
  42.         +-- 123
  43.  
  44. If you pass  in  just  the  drive  designation,  you  will  get  files  in  all
  45. subdirectories.  If you pass  in  "C:\TC",  you'll  get  all  files  in  C:\TC,
  46. C:\TC\KERMIT, and C:\TC\BANYAN.
  47.  
  48. DIRTOTAL then tries to total up the space used by subdirectory as well  as  for
  49. the entire disk.  The routine also  presents  subtotals  for  directories  with
  50. children.  For networked and CD-ROM discs, it will typically present the  wrong
  51. results when it comes to total disk space and total free space but the file and
  52. directory totals will all be correct.
  53.  
  54.  
  55. DIRTOTAL.DOC                           2                           Jul 31, 1997
  56.  
  57. DIRTOTAL creates an output file in the  default  directory  on  the  C:   drive
  58. called "DRIVE#s.DIR" (where "s" is the letter of the drive you  scanned)  which
  59. contains the file listings and total size reports.  If you restrict the  output
  60. to a specific subdirectory and its children, the  file  name  created  will  be
  61. called "DRIVE#sx.DIR", where  "x"  is  the  first  letter  of  the  restriction
  62. ("DIRTOTAL C:\TC" would create a file called "DRIVE#CT.DIR").  If you  ask  for
  63. more than one drive at a time (for example, "DIRTOTAL C: D: E:"), the file name
  64. will put the number of  drives  scanned  in  place  of  the  drive  letter  (so
  65. "DIRTOTAL C: D: E: \TC" would create a file called "DRIVE#3T.DIR").
  66.  
  67. The DIRTOTAL.EXE program was originally written in order to find out  how  much
  68. space the various files took on a CD-ROM disc.  However, it works fine on large
  69. disk drives and network drives.
  70.  
  71. Note:  When examining the  output  report,  you  may  find  some  weirdly-named
  72. eight-character file names (typically beginning with "A" or "B") in  your  root
  73. directory.  Typically, these will show up if you run DIRTOTAL on your C  drive.
  74. These files are temporary ISAM files created by the routine.  They are  deleted
  75. once the program is run.
  76.  
  77.  
  78. Specifying parameters:
  79.  
  80. Parameters for this program can be set in the following ways.  The last setting
  81. encountered always wins:
  82.   - Read from an *.INI file (see BRUCEINI.DOC file),
  83.   - Through the use of an environmental variable (SET DIRTOTAL=whatever), or
  84.   - From the command line (see "Syntax" below)
  85.  
  86.  
  87. Syntax:
  88.  
  89.     DIRTOTAL [ { drive: | filepath | filespec }... ]
  90.       [ /NORMAL | /WIDE | /THIN | /SPLIT ] [ /DUPS ] [ /CHILD ]
  91.       [ /NL ] [ /-HEADERS ] [ /-FOOTERS ] [ /CLUSTERS ] [ /TREE ] [ /A ]
  92.       [ /SIZE { GT | GE | LT | LE | EQ | NE } value ]
  93.       [ /DATE { GT | GE | LT | LE | EQ | NE } date ]
  94.       [ /ATTR=attribs ] [ /Frptfile ] [ /Z | /-Z ] [ /Ox | /O-x ] [ /TOP=n ]
  95.       [ /-SUB1 ] [ /-SUB2 ] [ /+DIR | /-DIR ] [ /n ]
  96.       [ /BEEP ] [ /Tpath ] [ /Q ] [ /Iinitfile | /-I ] [ /-ENV ] [ /? ]
  97.  
  98. where:
  99.  
  100. "drive:" is the letter of the drive you want to  scan  ("C:",  "D:",  "L:",  et
  101. cetera).  If no drive is specified, the routine presumes  you  want  all  files
  102. from your default drive.  You can specify multiple drives if you want.
  103.  
  104. "filepath"  retricts  the  listing  to  files  that  are   off   a   particular
  105. subdirectory.  Make sure you specify the "\" at  the  end  of  the  path.   For
  106. example, "DIRTOTAL C:\VBDOS\"
  107.  
  108. "filespec" restricts the listing to files that meet  some  file  specification.
  109. The restriction can  include  wildcards.   For  example,  "DIRTOTAL  C:\*.BAS".
  110. Multiple filespec or drive  specifications  are  fine.   (One  quirk:   If  you
  111. specify a filespec, the program will not show parent  subdirectory  totals  for
  112. parent subdirectories that are empty.)
  113.  
  114.  
  115. DIRTOTAL.DOC                           3                           Jul 31, 1997
  116.  
  117. "/NORMAL" is typically the default report format.  It produces a  report  which
  118. is 80-characters wide and has the complete file name listed on each  line  like
  119. this:
  120.  
  121. C:\ACD.IDX                                      09/26/93 00:34:50        575  a
  122. C:\AUTOEXEC.BAT                                 08/20/93 00:08:42        845  a
  123. C:\BOOT.CPS                                     05/06/93 18:56:28      1,024h
  124. C:\CHKLIST.CPS                                  05/20/93 22:23:06        135  a
  125. C:\CMOS.CPS                                     05/06/93 18:56:28         48
  126.  
  127. Note the last four characters show any special attributes set for the file:
  128.         a = archive bit set (the file hasn't been backed up yet)
  129.         h = hidden bit set
  130.         s = system file bit set
  131.         r = read-only file bit set
  132.  
  133. "/WIDE" produces a 126-character wide report with all  of  the  information  in
  134. fixed columns.  This is fine for compressed printing or  subsequent  processing
  135. by some other program.  The field positions are as follows:
  136.  
  137.         cols  1- 65 path (including drive)
  138.              67- 78 filename (or ZIP name)
  139.              80- 91 ZIP member name (if any)
  140.              93-100 file creation date
  141.             102-109 file creation time
  142.             111-121 file size in bytes
  143.             123-126 attributes
  144.  
  145. This option invokes /Z although you can specify /-Z if you want to override it.
  146. This option is primarily designed for people who need  a  complete  catalog  of
  147. everything in a CD-ROM and programs like CATDISK choke if you exceed 4000 files
  148. per disc.
  149.  
  150. "/THIN" produces a smaller report.  The directory name  is  printed  separately
  151. from the file name.  It automatically invokes the /CHILD option and produces  a
  152. report similar to this:
  153.  
  154. C:\
  155.   ACD.IDX                   09/26/93 00:34:50         575   a
  156.   AUTOEXEC.BAT              08/20/93 00:08:42         845   a
  157.   BOOT.CPS                  05/06/93 18:56:28       1,024 h
  158.   CHKLIST.CPS               05/20/93 22:23:06         135   a
  159.  
  160. "/SPLIT" creates the results file with the filename in a fixed field within the
  161. file.  If the subdirectory name doesn't fit, it's truncated.  The /WIDE  option
  162. is better if your subdirectory names exceed 35 characters (if /Z is  not  used)
  163. or 22 characters  (if  /Z  is  used)  unless  you're  particular  about  having
  164. 80-character or less reports.  A sample of the output with /Z:
  165.  
  166. D:\CLONE22\           PB22OBJ.LZH  ADDMATI.OBJ  05/01/93 11:14:58        124
  167. D:\CLONE22\           PB22OBJ.LZH  ADDMATL.OBJ  05/01/93 11:14:58        132
  168. D:\CLONE22\           PB22OBJ.LZH  ALLEXTME.OBJ 05/01/93 11:14:58        110
  169. D:\CLONE22\           PB22OBJ.LZH  ALTKEY.OBJ   05/01/93 11:11:54      1,282
  170.  
  171.  
  172. DIRTOTAL.DOC                           4                           Jul 31, 1997
  173.  
  174. "/DUPS" produces a report which shows all files with the  same  file  names  on
  175. your disk.  By default, it produces a report that's a modified version  of  the
  176. /THIN report:
  177.  
  178. CHKLIST.CPS
  179.   C:\                                           05/20/93 22:23:06        135  a
  180.   C:\DOS\                                       06/27/93 21:17:12        999  a
  181.   C:\TC\KERMIT\                                 05/06/93 19:02:22        108  a
  182.   C:\TC\TELIX\                                  07/10/93 10:28:22        135  a
  183.  
  184. /DUPS is incompatible with the /SUB, /CHILD, or /NL options.  If  you  want  to
  185. override the default /THIN report format using /DUPS, you have to  specify  the
  186. report format after the /DUPS option (for example, "DIRTOTAL  /DUPS  /NORMAL"),
  187. not before ("DIRTOTAL /NORMAL /DUPS" will ignore the /NORMAL option).
  188.  
  189. "/-DUPS" is the reverse of "/DUPS".
  190.  
  191. "/CHILD" produces a  listing  with  directory  subtotals  intermixed  with  the
  192. regular file names.  This is useful for visual effect but a problem if you  use
  193. the file as input into something else.  The option is automatically invoked for
  194. /THIN reports.  A sample:
  195.  
  196. C:\FATE\
  197.   ATLANTIS.INI              08/20/93 23:17:56         229   a
  198.   SAVEGAME.001              08/20/93 23:30:54      45,334   a
  199.     Total    2 files      45,563 bytes in C:\FATE\
  200.  
  201. "/NL" eliminates the listing of individual file  names  and  sizes  and  simply
  202. gives you the subdirectory totals.  This option overrides the /Z specification.
  203. This option is also incompatible with the /DUPS option.
  204.  
  205. "/-HEADERS" skips writing out the first couple of  introductory  lines  in  the
  206. output file which describe what options were used and such.  This is mainly  of
  207. use if you plan to process the output file electronically.
  208.  
  209. "/HEADERS" is the opposite of "/-HEADERS" and is initially the default.
  210.  
  211. "/-FOOTERS" skips writing out the summary information at the end of the  output
  212. file.  This includes the directory totals and such.  This is mainly of  use  if
  213. you plan to process the output file electronically.
  214.  
  215. "/FOOTERS" is the opposite of "/-FOOTERS" and is initially the default.
  216.  
  217. "/CLUSTERS" says to show file sizes in terms of cluster sizes (space allocated)
  218. instead of the normal bytes used.  DOS typically shows things in terms of bytes
  219. used.  Note that clusters aren't all that relevant on compressed drives  or  in
  220. the contents of compressed files.
  221.  
  222. "/-CLUSTERS" says to show file sizes in terms of bytes used.  This is  how  DOS
  223. normally shows things.  This is initially the default.
  224.  
  225.  
  226. DIRTOTAL.DOC                           5                           Jul 31, 1997
  227.  
  228. "/TREE" says that the subdirectory totals are to be presented  in  a  tree-like
  229. fashion.  For example:
  230.  
  231.   42        586,673 C:\
  232.   31        209,465 ├─ BANSAS
  233.   21        116,795 │  ├─ ARCHIVE
  234.    1          1,146 │  └─ SASUSER
  235.   91         21,541 ├─ BAT
  236.    2        152,494 ├─ COMPRESS
  237.   97      2,984,997 ├─ DOS
  238.  
  239. The actual characters used is dependent on the /A setting (below).  The initial
  240. default is /-TREE (no trees) and /-A (use graphic  characters  like  the  above
  241. instead of text characters).
  242.  
  243. "/-TREE" shows the subdirectory totals in the simpler format.  For example:
  244.  
  245.   Dir C:\                                                  42        586,673
  246.   Dir C:\BANSAS                                            31        209,465
  247.   Dir C:\BANSAS\ARCHIVE                                    21        116,795
  248.   Dir C:\BANSAS\SASUSER                                     1          1,146
  249.   Dir C:\BAT                                               91         21,541
  250.   Dir C:\COMPRESS                                           2        152,494
  251.   Dir C:\DOS                                               97      2,984,997
  252.  
  253. "/A", when used with the /TREE parameter, produces  the  tree  using  DOS  text
  254. characters instead of graphics characters.  The initial default is "/-A".   For
  255. example:
  256.  
  257.   42        585,126 C:\
  258.   31        209,465 +- BANSAS
  259.   21        116,795 |  +- ARCHIVE
  260.    1          1,146 |  +- SASUSER
  261.   91         21,541 +- BAT
  262.    2        152,494 +- COMPRESS
  263.   97      2,984,997 +- DOS
  264.  
  265. "/-A", when used with the /TREE parameter, produces  the  tree  using  graphics
  266. characters.  This is initially the default and is shown above.
  267.  
  268.  
  269. DIRTOTAL.DOC                           6                           Jul 31, 1997
  270.  
  271. "/SIZE xx value" says you want to limit the list of individual files  to  those
  272. which meet a certain size requirement.   Due  to  DOS's  redirection  commands,
  273. relations like ">" and "<" don't  work  so  you  have  to  use  the  two-letter
  274. abbreviations:
  275.  
  276.         GT      greater than                    >
  277.         GE      greater than or equal to        >=
  278.         LT      less than                       <
  279.         LE      less than or equal to           <=
  280.         EQ      equal to                        =
  281.         NE      not equal to                    <>
  282.  
  283. Having said that, the only two you're likely to use are GT and GE.  The "value"
  284. is the size value you want tested for.  So "/SIZE GT 1000000"  would  find  all
  285. individual files with a filesize greater than one million bytes.  Note that the
  286. directory total information will still indicate all files, not  just  the  ones
  287. which meet your size limitation request.
  288.  
  289. "/DATE xx date" says to show only those files created before or after  a  given
  290. date.  As before, you have to use GT, GE, LT, LE, EQ, and NE for the relational
  291. operator.  "/DATE GE 10/01/91" would show only those files created on or  after
  292. October 1, 1991.  The format for the date is determined by your system settings
  293. (it might be "/DATE GE 10.01.91" in France).
  294.  
  295. "/ATTR=attribs" allows you to specify a combination of attributes that you want
  296. considered.  You can specify any combination of R (read-only),  H  (hidden),  S
  297. (system), or A (archive bit).  Precede any character(s)  with  "-"  to  exclude
  298. instead of include.  Unlike with  the  DOS  DIR  command,  the  inclusions  and
  299. exclusions are subject to "OR" conditions; /ATTR=HS will retrieve any file that
  300. is either hidden or a system file or both.   You  can  specify  "/ATTR=ALL"  to
  301. specify that all files are to be processed.  Initially  defaults  to  /ATTR=ALL
  302. (don't exclude any files from consideration).
  303.  
  304. "/Frptfile" says to write the results to a given file name.   By  default,  the
  305. results with go to C:DRIVE#ds.DIR, where "d" is the drive letter and "s" is the
  306. first letter of any path restriction used.  So "DIRTOTAL C:\*.*" would  default
  307. to /FC:DRIVE#C.DIR.  You can say /FSCRN:  if you want.   "DIRTOTAL  C:  /FSCRN:
  308. /NL" is useful.
  309.  
  310. "/Z" shows the contents of any ZIP, ARC, ARJ, LZH, PAK, or ZOO  file  too.   Is
  311. automatically invoked if /WIDE is specified.
  312.  
  313. "/-Z" reverses /Z and is the default unless /WIDE is specified.
  314.  
  315. "/Ox" and "/O-x" allow you to specify the display order for the files.  "x" can
  316. be one of the following:
  317.  
  318.          N = file name (exclusive of directory name)
  319.          E = file extension
  320.          D = file date and time (earliest date first)
  321.          S = file size of the original (non-compressed) file (smallest first)
  322.          O = order by directory, then file name
  323.  
  324. If you precede the "x" with a dash ("-"), the sort  will  be  done  in  reverse
  325. order.  Typically defaults to /OO.   Note  that  the  /THIN  option  makes  the
  326. directory name be the primary sorting index.
  327.  
  328.  
  329. DIRTOTAL.DOC                           7                           Jul 31, 1997
  330.  
  331. "/TOP=n" confines the listing of files to the top "n" items.  Can only be  used
  332. with /OD, /O-D, /OS, or /O-S.  Cannot be used with /NL.  The results shown  for
  333. /SUB1 and /SUB2 are not affected by this option.  Initially defaults to "/-TOP"
  334. which is the same thing as "/TOP=0".
  335.  
  336. "/-TOP" gives you all files, not just the top "n" ones.  This is initially  the
  337. default.
  338.  
  339. "/SUB1" gives you  subdirectory  totals  (how  many  bytes/files  are  in  this
  340. subdirectory).  This option is only relevant if the /THIN  option  isn't  used;
  341. /THIN automatically interweaves subdirectory totals within the  listing.   This
  342. is typically the default.
  343.  
  344. "/-SUB1" suppresses the printing of the individual subdirectory subtotals.  One
  345. thing you might want to do with this parameter is something like this:
  346.  
  347.         DIRTOTAL /NL /1 /-SUB1
  348.  
  349. which will give you just the total for each primary-level subdirectory  on  the
  350. default drive including information about all of the subdirectories included in
  351. those primary-level subdirectories.
  352.  
  353. "/SUB2" gives you cumulative subdirectory subtotals (including how  many  files
  354. and bytes are in subdirectories this level and below).  This is  typically  the
  355. default.
  356.  
  357. "/-SUB2" suppresses the printing of cumulative subdirectory subtotals.
  358.  
  359. "/+DIR" includes directories in the file  count  summary  at  the  end  of  the
  360. report.  This corresponds to what DOS shows when you do a DIR and is apparently
  361. useful on a Novell network.  The default is /-DIR.
  362.  
  363. "/-DIR" drops directories from the file count summary.  This is the default.
  364.  
  365. "/n" confines the subdirectory total list to only  those  entries  at  the  nth
  366. level subdirectory and above.  "/n" can be any  single-digit  value  between  0
  367. (only those files in the root) and 9 (typically all  of  them).   For  example,
  368. "/1" would only show the directories off the root, not the  subdirectories  off
  369. of these directories.
  370.  
  371. Note that in terms of the directory total information printed  using  /SUB1  or
  372. /SUB2, the "/n" parameter affects which directories prints.   For  /SUB1,  only
  373. information up to the nth level will be  shown.   For  /SUB2,  the  cummulative
  374. totals will reflect all subdirectories below each level (as  before),  but  the
  375. individual subdirectories themselves will not be printed out.  A useful way  to
  376. find out major disk pigs by major subdirectory  (when  you  don't  really  care
  377. about the individual files in each) is to say:
  378.  
  379.         DIRTOTAL /NL /1 /-SUB1 /SUB2
  380.  
  381. "/BEEP" gives you a beep when the  program  finishes.   Initially  defaults  to
  382. "/-BEEP".
  383.  
  384. "/-BEEP" does not give a tone when the program finishes.  This is initially the
  385. default.
  386.  
  387.  
  388. DIRTOTAL.DOC                           8                           Jul 31, 1997
  389.  
  390. "/Tpath" specifies where to write the temporary ISAM  files  that  the  routine
  391. needs.  ISAM data bases are used to store and sort the file names.  ISAM  files
  392. cannot be created reliably on certain types of drives.  Examples are "/TC:" and
  393. "/TC:\TEMP".  If  not  specified,  the  routine  writes  to  the  following  in
  394. sequence:
  395.  
  396.   - the value of any TEMP, then TMP, environmental variable
  397.   - C:\TEMP
  398.   - C:\
  399.  
  400. "/Q" turns off the file-by-file status reporting that the routine does.
  401.  
  402. "/MONO" (or "/-COLOR") does not  try  to  override  screen  colors.   Initially
  403. defaults to "/COLOR".
  404.  
  405. "/COLOR" (or  "/-MONO")  allows  screen  colors  to  be  overridden.   This  is
  406. initially the default.
  407.  
  408. "/Iinitfile" says to read an initialization file with the file name "initfile".
  409. The file specification *must* contain a period.  Initfiles are described in the
  410. BRUCEINI.DOC file.  Initially defaults to "/IDIRTOTAL.INI".
  411.  
  412. "/-I" (or "/INULL") says to skip loading the initialization file.
  413.  
  414. "/ENV" says to look for %var% occurrences  in  the  command  line  and  try  to
  415. resolve any apparent environmental variable references.  See  BRUCEINI.DOC  for
  416. more information.  This is initially the default.
  417.  
  418. "/-ENV" says to skip resolving apparent %var% occurrences in the command  line.
  419. Initially defaults to "/ENV".
  420.  
  421. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  422.  
  423.  
  424. Return codes:
  425.  
  426. DIRTOTAL returns the following ERRORLEVEL codes:
  427.  
  428.         0 = no problems
  429.       250 = operation aborted by pressing Escape
  430.       253 = no files found or invalid drive
  431.       254 = could not find a decent temporary output subdirectory
  432.       255 = syntax problems, or /? requested
  433.  
  434.  
  435.  
  436. DIRTOTAL.DOC                           9                           Jul 31, 1997
  437.  
  438. Author:
  439.  
  440. This program was written by Bruce Guthrie of Wayne Software.  It  is  free  for
  441. use and  redistribution  provided  relevant  documentation  is  kept  with  the
  442. program, no changes are made to the program or documentation,  and  it  is  not
  443. bundled with commercial programs or charged for separately.  People who need to
  444. bundle it in for-sale packages must  pay  a  $50  registration  fee  to  "Wayne
  445. Software" at the following address.
  446.  
  447. Additional information about this and other  Wayne  Software  programs  can  be
  448. found in the file BRUCE.DOC which should be included in the original ZIP  file.
  449. The recent change history for this and the other programs is  provided  in  the
  450. HISTORY.ymm file which should be in the same ZIP file where "y" is replaced  by
  451. the last digit of the year and "mm" is the two  digit  month  of  the  release;
  452. HISTORY.611 came out in November 1996.  This same naming convention is used  in
  453. naming the ZIP file (DIRTOymm.ZIP) that this program was included in.
  454.  
  455. Comments and suggestions can also be sent to:
  456.  
  457.                 Bruce Guthrie
  458.                 Wayne Software
  459.                 113 Sheffield St.
  460.                 Silver Spring, MD 20910
  461.  
  462.                 e-mail: WayneSof@erols.com   fax: (301) 588-8986
  463.                 http://www.geocities.com/SiliconValley/Lakes/2414
  464.  
  465. Please provide an Internet e-mail address on all correspondence.
  466.  
  467. 
  468.